﻿using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Simple.Services;
using Simple.Services.System.QHSEViolationCategory.Models;

namespace Simple.WebApi.Controllers.System;

/// <summary>
///隐患类别对应体系要素管理
/// </summary>
[Route("QHSEDangerCategoryHSE/[action]")]
[ApiController]
public class QHSEDangerCategoryHSEController : ControllerBase
{
    private readonly QHSEDangerCategoryHSEService _dangerCategoryHSEService;

    public QHSEDangerCategoryHSEController(QHSEDangerCategoryHSEService dangerCategoryHSEService)
    {
        _dangerCategoryHSEService = dangerCategoryHSEService;
    }
    /// <summary>
    /// 隐患类别对应体系要素列表
    /// </summary>
    [HttpGet]
    [CustomAuthorize("hdv_qhse_data")]
    public async Task<AppResult> List()
    {
        List<QHSEDangerCategoryHSEModel> menus = await _dangerCategoryHSEService.GetAsync();
        return AppResult.Status200OK(data: menus);
    }
    [HttpGet]
    [ValidateTimestampAndSignature]
    public async Task<AppResult> List1()
    {
        List<QHSEDangerCategoryHSEModel> menus = await _dangerCategoryHSEService.GetAsync();
        return AppResult.Status200OK(data: menus);
    }
    /// <summary>
    /// 隐患类别对应体系要素
    /// </summary>
    [HttpGet]
    [CustomAuthorize("hdv_qhse_data")]
    public async Task<AppResult> GetHSEResult([FromQuery]QHSEDangerCategoryHSEPageInputModel inputModel)
    {
         var data =  await _dangerCategoryHSEService.GetResult(inputModel);
        return AppResult.Status200OK(data: data);
    }
    [HttpGet]
    [ValidateTimestampAndSignature]
    public async Task<AppResult> GetHSEResult1([FromQuery] QHSEDangerCategoryHSEPageInputModel inputModel)
    {
        var data = await _dangerCategoryHSEService.GetResult(inputModel);
        return AppResult.Status200OK(data: data);
    }
}
